<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<link href="css/bootstrap.css" rel="stylesheet">
		<link href="css/layui.css" rel="stylesheet">
		<link href="css/layui.mobile.css" rel="stylesheet">
		<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="css/styles.css">
		<title>在线用户-大学课堂评价系统</title>


		<style>
			a:hover{text-decoration:none;}
        a.active{text-decoration:none;}
        html,body{height: 100%;margin: 0;}
        .row{margin-bottom: 10px}

        body{background: #f9f9f9;font-family: -apple-system,"Microsoft Yahei","Helvetica Neue",Helvetica,Arial,sans-serif;}


        @font-face {
            font-family: "lantingxihei";
            src: url("fonts/FZLTCXHJW.TTF");
        }

		/* 导航栏 */
		.header {
			background-color: #DEDEDE;
		}
		.container {
			padding-right: 40px;
			padding-left: 40px;
		}
		.navbar-nav{
			margin-left: 20px;
		}
		
        /* modal 模态框*/
        #invite-user .modal-body {
            overflow: hidden;
        }
        #invite-user .modal-body .form-label {
            margin-bottom: 16px;
            font-size:14px;
        }
        #invite-user .modal-body .form-invite {
            width: 80%;
            padding: 6px 12px;
            background-color: #eeeeee;
            border: 1px solid #cccccc;
            border-radius: 5px;
            float: left;
            margin-right: 10px;
        }
        #invite-user .modal-body .msg-modal-style {
            background-color: #7dd383;
            margin-top: 10px;
            padding: 6px 0;
            text-align: center;
            width: 100%;
        }
        #invite-user .modal-body .modal-flash {
            position: absolute;
            top: 53px;
            right: 74px;
            z-index: 999;
        }
        /* end modal */

        .en-footer {
            padding: 30px;
            text-align: center;
            font-size: 14px;
        }
    </style>


	</head>

	<body>
		<jsp:include page="top.jsp"/>
		<div class="container layout layout-margin-top">
			<ol class="breadcrumb">
				<li><a href="index.html">主页</a></li>
				<li class="active">在线学生</li>
			</ol>
			<!--中心-->
			<div class="row">
				<div class="col-md-12">
							<div class="panel panel-success">
								<!-- Default panel contents -->
								<div class="panel-heading">学生信息</div>
								<!-- Table -->
								<table class=" text-center table table-hover table-striped">
									<!-- On rows -->
									<thead>
										<tr>
											<th>序号</th>
											<th>学号</th>
											<th>姓名</th>
											<th>班级名称</th>
											<th>年级</th>
											<th>所在小组</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${applicationScope.onlineUser }" var="u" varStatus="status">
										<tr>
											<td>${status.count}</td>
											<td>${u.value.studentID}</td>
											<td>${u.value.studentName}</td>
											<td>${u.value.gclass.className}</td>
											<td>${u.value.gclass.classYear}</td>
											<td>${u.value.ggroup.groupName}</td>
										</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
				</div>
				</div>
			<!--中心-row-->
		</div>
		<!--container-->
		<!-- 修改信息模态框 -->
		<div class="modal fade" id="revision" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h3 class="modal-title" id="">修改班级信息</h3>
      </div>
      <div class="modal-body">
        <form action="ClassInfoServlet" method="post">
        <input type="hidden" name="classID" value="${requestScope.classList[0].classID}">
        <input type="hidden" name="action" value="update">
          <div class="form-group">
            <label for="grade" class="control-label">年级:</label>
            <input type="text" class="form-control" name="classYear" value="" id="grade">
          </div>
          <div class="form-group">
          <label for="grade-name" class="control-label">班级名称:</label>
          <input type="text" class="form-control" name="className" value="" id="grade-name">
          </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">保存</button>
      </div>
	  </form>
    </div>
  </div>
</div>
<!-- 修改信息模态框结束 -->
		
<jsp:include page="footer.jsp"/>

<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/layui.all.js"></script>
<script>
$('#revision').on('show.bs.modal', function(e) {
    //get data-id attribute of the clicked element
    var year = $(e.relatedTarget).data('year');
    var name = $(e.relatedTarget).data('name');
    //populate the textbox
    $(e.currentTarget).find('input[name="classYear"]').val(year);
    $(e.currentTarget).find('input[name="className"]').val(name);
});
</script>
</body>
</html>
